<!DOCTYPE html>
<html lang="en">

<head>
    <title>Example</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style>
        table {
            border: solid thin black;
            border-collapse: collapse;
            margin: 5px 2px;
            float: left;
        }
        
        td {
            padding: 4px 5px;
        }
        
        p {
            clear: left;
        }
    </style>
</head>

<body>
    <table border="1">
        <thead>
            <tr>
                <th>Fruit</th>
                <th>Color</th>
            </tr>
        </thead>
        <tbody>
            <tr id="applerow">
                <td>Plum</td>
                <td>Purple</td>
            </tr>
        </tbody>
    </table>
    <textarea rows="3" id="results"></textarea>
    <p>
        <button id="inner">Inner HTML</button>
        <button id="outer">Outer HTML</button>
    </p>

    <script>
        var results = document.getElementById('results');
        var row = document.getElementById('applerow');

        document.getElementById('inner').onclick = function () {
            results.innerHTML = row.innerHTML;
        };

        document.getElementById('outer').onclick = function () {
            results.innerHTML = row.outerHTML;
        };
    </script>
</body>

</html>